home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 275 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.0 KB  |  74 lines

  1. Path: news1.h1.usa.pipeline.com!usenet
  2. From: grantp@usa.pipeline.com(Pete)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: I need help with a compiler
  5. Date: 3 Jan 1996 22:30:18 GMT
  6. Organization: Kalevi, Inc
  7. Message-ID: <4cf01q$3fp@news1.usa.pipeline.com>
  8. NNTP-Posting-Host: pipe6.h1.usa.pipeline.com
  9. X-PipeUser: grantp
  10. X-PipeHub: usa.pipeline.com
  11. X-PipeGCOS: (Pete)
  12. X-Newsreader: Pipeline USA v3.3.0
  13.  
  14. On Jan 02, 1996 14:25:14 in article <I need help with a compiler>,
  15. 'loople@gcomm.com (Mike Lopier)' wrote: 
  16.  
  17. >I am trying to *learn* C so i bought 2 books, 1 for learning C and 
  18. >another to move from C to C++, one of them came with a compiler called 
  19. >GNU but I write a simple program like: 
  20. >#include <iostream.h> 
  21. >main () 
  22. >{ 
  23. >cout "Hello"; 
  24. >} 
  25.  
  26. This is a C newsgroup.  <iostream.h> and cout are C++ stuff.  Which are 
  27. you tryig to learn?  If it's C, do this: 
  28. #include <stdio.h> 
  29. int main () 
  30.  { 
  31.     printf("Hello, World!\n"); 
  32.     return 0; 
  33.  } 
  34.  
  35. If C++, then try: 
  36.  
  37. #include <iostream.h> 
  38. int main () 
  39.  { 
  40.     cout << "Hello\n"; 
  41.     return 0; 
  42.  } 
  43.  
  44. >And when i tried to compile it I get a Iostream.h -- file not found 
  45. >Well i've copied the .cpp, the iostream.h, and teh compiler all into the 
  46. >same directory and it still gave me that error. I've even put it in the 
  47. >path but still it keeps saying 'file not found'...There are no options 
  48. >for 'path of header files' or something...it is a command line 
  49. >compiler..So i am thouroughly confused and frustrated. If anyone out 
  50. >there knows why even though i know that i didn't give you enough info 
  51. >that's all i can come up with and I have no idea why it won't work. 
  52.  
  53. Right, not enough info.  What platform? I assume DOS -- if not, 
  54. disregard.   
  55.  
  56. The GNU compiler may be gcc or one of its relatives.  If so,  
  57. you can use the -I option to specify paths; e.g., something like: 
  58.  
  59. gcc -IC:\GNU\INCLUDE 
  60.  
  61. Some older versions of gnu gcc copiler also did not like file 
  62. extension .cpp.  Try changing it to .c or .cc 
  63. -- 
  64.  
  65. Pete 
  66.  
  67.  
  68.  
  69.  
  70.  
  71.